import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import directive from './directive/dialog/index' // directive
// 富文本编辑器 quill 的使用 start
import VueQuillEditor from 'vue-quill-editor'
// 一定要引入这三个css，不然文本编辑器会出现不规则黑白几何图形
// 这三个css可以在main.js中引入，也可以在具体使用的.vue文件中引入
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import Quill from 'quill'
import { ImageDrop } from 'quill-image-drop-module'
import ImageResize from 'quill-image-resize-module'
import quillEmoji from 'quill-emoji'
import VueClipboard from 'vue-clipboard2' // 复制
import secondary from '@/components/secondary/index.vue'
import 'quill-emoji/dist/quill-emoji.css'
Quill.register('modules/imageDrop', ImageDrop)
Quill.register('modules/imageResize', ImageResize)
Quill.register('modules/quillEmoji', quillEmoji)
// 富文本编辑器 quill 的使用 end
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import componentsArr from './kcomponents' // 组件全局注册
import 'element-ui/lib/theme-chalk/index.css'
import { resetForm, isNullOrEmpty,getImageUrl } from './utils/validate'
import { authorityHandle } from './utils/authority'
import './utils/log'
Vue.prototype.$resetForm = resetForm // 清空表单信息
Vue.prototype.$isNullOrEmpty = isNullOrEmpty // 清空表单信息
Vue.prototype.$getImageUrl = getImageUrl // 拼接的url
Vue.prototype.authorityHandle = authorityHandle // 页面权限方法

import '@/icons' // icon
import '@/permission' // permission control
// 字典数据组件
import DictData from '@/components/DictData'
Vue.use(DictData)

Vue.component('secondary', secondary)

componentsArr.forEach(com => {
  Vue.use(com)
})

Vue.use(ElementUI)
Vue.use(directive)
Vue.use(VueQuillEditor)
Vue.use(VueClipboard)
Vue.config.productionTip = false

// 引入echarts
// const echarts =require('echarts')
// Vue.prototype.$echarts = echarts

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
